
powershell npm install -g nativefier
git config --global user.email yanfengz@outlook.com
git config --global user.name Isidore

git clone https://mirror.ghproxy.com/https://github.com/denBot/yasb $env:USERPROFILE\Applications\yasb
# pip install -r $env:USERPROFILE\Applications\yasb\requirements.txt

# $isContain = $env:Path -like "*komorebi*"
# if (-not $isContain) {
#     $env:Path += ";C:\Program Files\komorebi\bin"
#     Start-Process powershell -Verb runAs -ArgumentList 'NoExit', '-Command', ' [System.Environment]::SetEnvironmentVariable("Path", $env:Path, "Machine")'
# }


function Create-Folder {
    param (
        [Parameter(Mandatory=$true)]
        [string]$FolderPath
    )
    if (!(Test-Path -Path $FolderPath)) {
        New-Item -ItemType Directory -Path $FolderPath
    }
}

Create-Folder -FolderPath $env:USERPROFILE\AppData\Local\nvim

$scriptBlock = {
Copy-Item -Path "$Home\chezmoi\windows\yasb\FontAwesome6Free-Solid-900.otf" -Destination "C:\\Windows\Fonts"
    New-Item -ItemType SymbolicLink -Target "$env:USERPROFILE\chezmoi\windows\glaze-wm\config.yaml" -Path "$env:USERPROFILE\.glaze-wm\config.yaml" -Force
    New-Item -ItemType SymbolicLink -Target "$env:USERPROFILE\chezmoi\windows\Profile.ps1" -Path "$env:USERPROFILE\Documents\PowerShell\Microsoft.PowerShell_profile.ps1" -Force
    New-Item -ItemType SymbolicLink -Target "$env:USERPROFILE\chezmoi\windows\Profile.ps1" -Path "$env:USERPROFILE\Documents\WindowsPowerShell\Profile.ps1" -Force
    New-Item -ItemType SymbolicLink -Target "$env:USERPROFILE\chezmoi\windows\komorebi\whkdrc" -Path "$env:USERPROFILE\.config\whkdrc" -Force
    New-Item -ItemType SymbolicLink -Target "$env:USERPROFILE\chezmoi\windows\komorebi\applications.yaml" -Path "$env:USERPROFILE\applications.yaml" -Force
    New-Item -ItemType SymbolicLink -Target "$env:USERPROFILE\chezmoi\windows\komorebi\komorebi.json" -Path "$env:USERPROFILE\komorebi.json" -Force
    New-Item -ItemType SymbolicLink -Target "$env:USERPROFILE\chezmoi\windows\yasb\styles.css" -Path "$env:USERPROFILE\.yasb\styles.css" -Force
    New-Item -ItemType SymbolicLink -Target "$env:USERPROFILE\chezmoi\windows\yasb\config.yaml" -Path "$env:USERPROFILE\.yasb\config.yaml" -Force
    New-Item -ItemType SymbolicLink -Target "$env:USERPROFILE\chezmoi\dot_init.vim" -Path "$env:USERPROFILE\AppData\Local\nvim\init.vim" -Force
    # New-Item -ItemType SymbolicLink -Target "$env:USERPROFILE\chezmoi\windwos\start.ps1" -Path "$env:USERPROFILE\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\start.ps1" -Force
    New-Item -ItemType SymbolicLink -Target "$env:USERPROFILE\chezmoi\windows\start.ps1" -Path "'$env:USERPROFILE\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\start.ps1'" -Force
}
Start-Process -FilePath "powershell" -Verb RunAs -ArgumentList "-Command", $scriptBlock.ToString()
# sudo Start-Process -FilePath "powershell" -Verb RunAs -ArgumentList "-Command", ($scriptBlock -join " ")
# git clone https://github.com/NvChad/NvChad C:\Application\NvChad --depth 1

$newPath = "$env:USERPROFILE\AppData\Roaming\Microsoft\Windows\Start Menu\Programs"
# 获取当前的环境变量PATH
$currentPath = [Environment]::GetEnvironmentVariable("Path", "User")
# 检查新路径是否已经存在于PATH中
if ($currentPath -notmatch [regex]::Escape($newPath)) {
    # 如果不存在，则添加到PATH中
    $newPathWithSemicolon = "$newPath;" # 确保路径之间有分隔符
    $updatedPath = $currentPath + $newPathWithSemicolon
    # 设置新的PATH环境变量
    # echo $updatedPath
    [Environment]::SetEnvironmentVariable("Path", $updatedPath, "User") # "Machine" 表示系统级，若要用户级则使用 "User"
}
$userPath = [Environment]::GetEnvironmentVariable("Path", "User")
Write-Host "用户PATH是: $userPath"
getuserreadgetuserread者模式 -> 开启 “USB调试” “